3.2 \(\int \frac{(a+b x) (c+d x) (e+f x)}{g+h x} \, dx\)

Optimal. Leaf size=126 \[ \frac{x^2 (a d f h-b (-c f h-d e h+d f g))}{2 h^2}+\frac{x (b (d g-c h) (f g-e h)-a h (-c f h-d e h+d f g))}{h^3}-\frac{(b g-a h) (d g-c h) (f g-e h) \log (g+h x)}{h^4}+\frac{b d f x^3}{3 h} \]

[Out]

((b*(d*g - c*h)*(f*g - e*h) - a*h*(d*f*g - d*e*h - c*f*h))*x)/h^3 + ((a*d*f*h - b*(d*f*g - d*e*h - c*f*h))*x^2
)/(2*h^2) + (b*d*f*x^3)/(3*h) - ((b*g - a*h)*(d*g - c*h)*(f*g - e*h)*Log[g + h*x])/h^4

________________________________________________________________________________________

Rubi [A]  time = 0.211189, antiderivative size = 126, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.043, Rules used = {142} \[ \frac{x^2 (a d f h-b (-c f h-d e h+d f g))}{2 h^2}+\frac{x (b (d g-c h) (f g-e h)-a h (-c f h-d e h+d f g))}{h^3}-\frac{(b g-a h) (d g-c h) (f g-e h) \log (g+h x)}{h^4}+\frac{b d f x^3}{3 h} \]

Antiderivative was successfully verified.

[In]

Int[((a + b*x)*(c + d*x)*(e + f*x))/(g + h*x),x]

[Out]

((b*(d*g - c*h)*(f*g - e*h) - a*h*(d*f*g - d*e*h - c*f*h))*x)/h^3 + ((a*d*f*h - b*(d*f*g - d*e*h - c*f*h))*x^2
)/(2*h^2) + (b*d*f*x^3)/(3*h) - ((b*g - a*h)*(d*g - c*h)*(f*g - e*h)*Log[g + h*x])/h^4

Rule 142

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_) + (f_.)*(x_))*((g_.) + (h_.)*(x_)), x_Symbol]
:> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)*(g + h*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, h},
x] && (IGtQ[m, 0] || IntegersQ[m, n])

Rubi steps

\begin{align*} \int \frac{(a+b x) (c+d x) (e+f x)}{g+h x} \, dx &=\int \left (\frac{b (d g-c h) (f g-e h)-a h (d f g-d e h-c f h)}{h^3}+\frac{(a d f h-b (d f g-d e h-c f h)) x}{h^2}+\frac{b d f x^2}{h}+\frac{(-b g+a h) (-d g+c h) (-f g+e h)}{h^3 (g+h x)}\right ) \, dx\\ &=\frac{(b (d g-c h) (f g-e h)-a h (d f g-d e h-c f h)) x}{h^3}+\frac{(a d f h-b (d f g-d e h-c f h)) x^2}{2 h^2}+\frac{b d f x^3}{3 h}-\frac{(b g-a h) (d g-c h) (f g-e h) \log (g+h x)}{h^4}\\ \end{align*}

Mathematica [A]  time = 0.0894686, size = 123, normalized size = 0.98 \[ \frac{h x \left (3 a h (2 c f h+d (2 e h-2 f g+f h x))+b \left (3 c h (2 e h-2 f g+f h x)+3 d e h (h x-2 g)+d f \left (6 g^2-3 g h x+2 h^2 x^2\right )\right )\right )-6 (b g-a h) (d g-c h) (f g-e h) \log (g+h x)}{6 h^4} \]

Antiderivative was successfully verified.

[In]

Integrate[((a + b*x)*(c + d*x)*(e + f*x))/(g + h*x),x]

[Out]

(h*x*(3*a*h*(2*c*f*h + d*(-2*f*g + 2*e*h + f*h*x)) + b*(3*d*e*h*(-2*g + h*x) + 3*c*h*(-2*f*g + 2*e*h + f*h*x)
+ d*f*(6*g^2 - 3*g*h*x + 2*h^2*x^2))) - 6*(b*g - a*h)*(d*g - c*h)*(f*g - e*h)*Log[g + h*x])/(6*h^4)

________________________________________________________________________________________

Maple [B]  time = 0.004, size = 246, normalized size = 2. \begin{align*}{\frac{bdf{x}^{3}}{3\,h}}+{\frac{{x}^{2}adf}{2\,h}}+{\frac{{x}^{2}bcf}{2\,h}}+{\frac{d{x}^{2}be}{2\,h}}-{\frac{d{x}^{2}bfg}{2\,{h}^{2}}}+{\frac{acfx}{h}}+{\frac{adex}{h}}-{\frac{adfgx}{{h}^{2}}}+{\frac{bcex}{h}}-{\frac{bcfgx}{{h}^{2}}}-{\frac{bdegx}{{h}^{2}}}+{\frac{bdf{g}^{2}x}{{h}^{3}}}+{\frac{\ln \left ( hx+g \right ) ace}{h}}-{\frac{\ln \left ( hx+g \right ) acfg}{{h}^{2}}}-{\frac{\ln \left ( hx+g \right ) adeg}{{h}^{2}}}+{\frac{\ln \left ( hx+g \right ) adf{g}^{2}}{{h}^{3}}}-{\frac{\ln \left ( hx+g \right ) bceg}{{h}^{2}}}+{\frac{\ln \left ( hx+g \right ) bcf{g}^{2}}{{h}^{3}}}+{\frac{\ln \left ( hx+g \right ) bde{g}^{2}}{{h}^{3}}}-{\frac{\ln \left ( hx+g \right ) bdf{g}^{3}}{{h}^{4}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)*(d*x+c)*(f*x+e)/(h*x+g),x)

[Out]

1/3*b*d*f*x^3/h+1/2/h*x^2*a*d*f+1/2/h*x^2*b*c*f+1/2/h*x^2*b*d*e-1/2/h^2*x^2*b*d*f*g+1/h*a*c*f*x+1/h*a*d*e*x-1/
h^2*a*d*f*g*x+1/h*b*c*e*x-1/h^2*b*c*f*g*x-1/h^2*b*d*e*g*x+1/h^3*b*d*f*g^2*x+1/h*ln(h*x+g)*a*c*e-1/h^2*ln(h*x+g
)*a*c*f*g-1/h^2*ln(h*x+g)*a*d*e*g+1/h^3*ln(h*x+g)*a*d*f*g^2-1/h^2*ln(h*x+g)*b*c*e*g+1/h^3*ln(h*x+g)*b*c*f*g^2+
1/h^3*ln(h*x+g)*b*d*e*g^2-1/h^4*ln(h*x+g)*b*d*f*g^3

________________________________________________________________________________________

Maxima [A]  time = 1.15018, size = 219, normalized size = 1.74 \begin{align*} \frac{2 \, b d f h^{2} x^{3} - 3 \,{\left (b d f g h -{\left (b d e +{\left (b c + a d\right )} f\right )} h^{2}\right )} x^{2} + 6 \,{\left (b d f g^{2} -{\left (b d e +{\left (b c + a d\right )} f\right )} g h +{\left (a c f +{\left (b c + a d\right )} e\right )} h^{2}\right )} x}{6 \, h^{3}} - \frac{{\left (b d f g^{3} - a c e h^{3} -{\left (b d e +{\left (b c + a d\right )} f\right )} g^{2} h +{\left (a c f +{\left (b c + a d\right )} e\right )} g h^{2}\right )} \log \left (h x + g\right )}{h^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(d*x+c)*(f*x+e)/(h*x+g),x, algorithm="maxima")

[Out]

1/6*(2*b*d*f*h^2*x^3 - 3*(b*d*f*g*h - (b*d*e + (b*c + a*d)*f)*h^2)*x^2 + 6*(b*d*f*g^2 - (b*d*e + (b*c + a*d)*f
)*g*h + (a*c*f + (b*c + a*d)*e)*h^2)*x)/h^3 - (b*d*f*g^3 - a*c*e*h^3 - (b*d*e + (b*c + a*d)*f)*g^2*h + (a*c*f
+ (b*c + a*d)*e)*g*h^2)*log(h*x + g)/h^4

________________________________________________________________________________________

Fricas [A]  time = 1.21161, size = 359, normalized size = 2.85 \begin{align*} \frac{2 \, b d f h^{3} x^{3} - 3 \,{\left (b d f g h^{2} -{\left (b d e +{\left (b c + a d\right )} f\right )} h^{3}\right )} x^{2} + 6 \,{\left (b d f g^{2} h -{\left (b d e +{\left (b c + a d\right )} f\right )} g h^{2} +{\left (a c f +{\left (b c + a d\right )} e\right )} h^{3}\right )} x - 6 \,{\left (b d f g^{3} - a c e h^{3} -{\left (b d e +{\left (b c + a d\right )} f\right )} g^{2} h +{\left (a c f +{\left (b c + a d\right )} e\right )} g h^{2}\right )} \log \left (h x + g\right )}{6 \, h^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(d*x+c)*(f*x+e)/(h*x+g),x, algorithm="fricas")

[Out]

1/6*(2*b*d*f*h^3*x^3 - 3*(b*d*f*g*h^2 - (b*d*e + (b*c + a*d)*f)*h^3)*x^2 + 6*(b*d*f*g^2*h - (b*d*e + (b*c + a*
d)*f)*g*h^2 + (a*c*f + (b*c + a*d)*e)*h^3)*x - 6*(b*d*f*g^3 - a*c*e*h^3 - (b*d*e + (b*c + a*d)*f)*g^2*h + (a*c
*f + (b*c + a*d)*e)*g*h^2)*log(h*x + g))/h^4

________________________________________________________________________________________

Sympy [A]  time = 0.972131, size = 141, normalized size = 1.12 \begin{align*} \frac{b d f x^{3}}{3 h} + \frac{x^{2} \left (a d f h + b c f h + b d e h - b d f g\right )}{2 h^{2}} + \frac{x \left (a c f h^{2} + a d e h^{2} - a d f g h + b c e h^{2} - b c f g h - b d e g h + b d f g^{2}\right )}{h^{3}} + \frac{\left (a h - b g\right ) \left (c h - d g\right ) \left (e h - f g\right ) \log{\left (g + h x \right )}}{h^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(d*x+c)*(f*x+e)/(h*x+g),x)

[Out]

b*d*f*x**3/(3*h) + x**2*(a*d*f*h + b*c*f*h + b*d*e*h - b*d*f*g)/(2*h**2) + x*(a*c*f*h**2 + a*d*e*h**2 - a*d*f*
g*h + b*c*e*h**2 - b*c*f*g*h - b*d*e*g*h + b*d*f*g**2)/h**3 + (a*h - b*g)*(c*h - d*g)*(e*h - f*g)*log(g + h*x)
/h**4

________________________________________________________________________________________

Giac [A]  time = 1.30425, size = 281, normalized size = 2.23 \begin{align*} \frac{2 \, b d f h^{2} x^{3} - 3 \, b d f g h x^{2} + 3 \, b c f h^{2} x^{2} + 3 \, a d f h^{2} x^{2} + 3 \, b d h^{2} x^{2} e + 6 \, b d f g^{2} x - 6 \, b c f g h x - 6 \, a d f g h x + 6 \, a c f h^{2} x - 6 \, b d g h x e + 6 \, b c h^{2} x e + 6 \, a d h^{2} x e}{6 \, h^{3}} - \frac{{\left (b d f g^{3} - b c f g^{2} h - a d f g^{2} h + a c f g h^{2} - b d g^{2} h e + b c g h^{2} e + a d g h^{2} e - a c h^{3} e\right )} \log \left ({\left | h x + g \right |}\right )}{h^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(d*x+c)*(f*x+e)/(h*x+g),x, algorithm="giac")

[Out]

1/6*(2*b*d*f*h^2*x^3 - 3*b*d*f*g*h*x^2 + 3*b*c*f*h^2*x^2 + 3*a*d*f*h^2*x^2 + 3*b*d*h^2*x^2*e + 6*b*d*f*g^2*x -
 6*b*c*f*g*h*x - 6*a*d*f*g*h*x + 6*a*c*f*h^2*x - 6*b*d*g*h*x*e + 6*b*c*h^2*x*e + 6*a*d*h^2*x*e)/h^3 - (b*d*f*g
^3 - b*c*f*g^2*h - a*d*f*g^2*h + a*c*f*g*h^2 - b*d*g^2*h*e + b*c*g*h^2*e + a*d*g*h^2*e - a*c*h^3*e)*log(abs(h*
x + g))/h^4